﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebService1
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            doTest();
            return "Hello World";
           
        }       
        public void RecieSMS()
        {
           
        }
        [WebMethod]
        public void doTest()
        {
            Auth A = new Auth();
            ServiceReference1.auth auth = new ServiceReference1.auth();
            auth.userName = A.Username;
            auth.password = A.Password;
            auth.timestamp = A.Time;

            try
            {
                
                ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
                client.Open();

                var kq= client.sendMessageByPhone(auth, "0939421192", "test demo");

                var result = client.sendMessageById(auth, 100019401, "test demo");
                client.Close();
            }
            catch(Exception e) 
            {
                
            }
        }
        [WebMethod]
        public string Processsms(string sms,string phone)
        {
            string kq="";
            AuthSMS au = new AuthSMS();
            kq = 
            return kq;
        }

        
        

        public string Process1()
        {
            Auth A = new Auth();
            ServiceReference1.auth auth = new ServiceReference1.auth();
            auth.userName = A.Username;
            auth.password = A.Password;
            auth.timestamp = A.Time;
            ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
            
            client.sendMessageByPhone(auth, "0939421192", "test demo");

            return "demo";
            
        }
      
    }
}